<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!-- 右侧区域 -->
		<div class="right">
			<div class='hd_title'>
				<strong>标签云</strong>	
			</div>
			<div id="tagBox" class='tags'>
				<?php
		$result = K('Tag')->findAllTagLimit(20);
		foreach($result as $tag):
			$tid = $tag['tid']; 
			$midd = M('article_tag')->where("tag_tid=$tid")->all();
			if(!$midd){
				continue;
			}
?>
	
				<a href="http://127.0.0.1/cms/cms/index.php/Index/list/index/tid/<?php echo $tag['tid'];?>"><?php echo $tag['tagname'];?></a>
				
<?php
	endforeach;	
?>
			</div>
			<div class='hd_title'>
				<strong>热门文章</strong>	
			</div>
			<ul class='arc_list'>
					<?php
		$result = K('article')->findSpeExp('is_recycle=0','click DESC',8);
		foreach($result as $hotart):
		$hotart['thumb']  = 'http://127.0.0.1/cms/cms/'.$hotart['thumb'];
		$hotart['commnum'] = K('Comment')->findCountComment($hotart['aid']);
		//生成连接地址
		$hotart['url'] = getStaticPath($hotart['is_archtml'],$hotart['htmldir'],$hotart['aid']);
?>
		
					<li>
						<div class='image'>
							<a href="<?php echo $hotart['url'];?>">
								<img src="<?php echo $hotart['thumb'];?>" alt="<?php echo hd_substr($hotart['title'],23,'...');?>" />
							</a>
						</div>
						<h2><a href="<?php echo $hotart['url'];?>"><?php echo hd_substr($hotart['title'],23,'...');?></a></h2>
						<p>
							<em><?php echo date('m-d',$hotart['sendtime']);?></em><span><?php echo $hotart['commnum'];?>条评论</span>
						</p>
					</li>
					
<?php
	endforeach;
?>
			</ul>
			<div class='hd_title'>
				<strong>推荐文章</strong>	
			</div>
			
			<ul class='arc_list'>
					<?php
		$result = K('article')->findSpeExp('is_recycle=0 AND attr LIKE "%推荐%"','click DESC',8);
		foreach($result as $recom):
		$recom['thumb']  = 'http://127.0.0.1/cms/cms/'.$recom['thumb'];
		$recom['commnum'] = K('Comment')->findCountComment($recom['aid']);
		//生成连接地址
		$recom['url'] = getStaticPath($recom['is_archtml'],$recom['htmldir'],$recom['aid']);
?>
		
					<li>
						<div class='image'>
							<a href="<?php echo $recom['url'];?>">
								<img src="<?php echo $recom['thumb'];?>" alt="<?php echo hd_substr($recom['title'],25,'...');?>"/>
							</a>
						</div>
						<h2><a href="<?php echo $recom['url'];?>"><?php echo hd_substr($recom['title'],25,'...');?></a></h2>
						<p>
							<em><?php echo date('m-d',$recom['sendtime']);?></em><span><?php echo $recom['commnum'];?>条评论</span>
						</p>
					</li>
					
<?php
	endforeach;
?>		
			</ul>
		</div>
		<!-- 右侧区域结束 -->